﻿using FPSO.HMI.Controls;
using FPSO.Models.Domain;
using FPSO.Services.Utils;
using MySql.Data.MySqlClient;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Opc.Ua;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FPSO.Services.Impl
{
	public class DBShipTankStatusBackupLogService : DbRepository<ShipTankStatusBackupLog>
	{
		public void AddShipTankStatusLog(ShipTankStatusBackupLog log)
		{
			log.LogUpdateTime = DateTime.Now;
			InsertEntity(log);
		}

		public void DeleteShipTankStatusLog(int logid)
		{
			DeleteById(logid);
		}

		public ShipTankStatusBackupLog GetShipTankStatusLog(int logId)
		{
			ShipTankStatusBackupLog log = QueryEntity(t => t.LogId == logId);
			return log;
		}

		public void UpdateTask(ShipTankStatusBackupLog log)
		{
			UpdateEntity(log);
		}

		public int GetDataCount()
		{
			return QueryCount(t => t.LogUpdateTime >= DateTime.MinValue);
		}

		public void FlushDatas()
		{
			FlushEntitys();
		}
	}
}
